<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/setting.css" />
		<script type="text/javascript">
			// 获取HTML的DOM
			var htmlDom = document.getElementsByTagName('html')[0];
			var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
			// 设置html的fontsize
			htmlDom.style.fontSize = htmlWidth / 10 + 'px';
		</script>
	</head>

	<body style="background-color: #F4F4F4;">
		<div class="bottom-bow"></div>
		<div id="user">
			<div class="header">
				<div class="header-title">设置</div>
				<div class="header-desc">
					<div class="desc-wapper">
						<div class="name" id='name'><!-- 用户名 --></div>
						<div class="position" id='account'><!-- 用户账号 --></div>
					</div>
					<div class="desc-portrait">
						<img src="../images/mypic.png" alt="" />
					</div>
				</div>
			</div>
			<div class="list">
				<div class="item" @click="messageClick">
					<div class="item-icon">
						<img src="../images/myOrder.png" />
					</div>
					<div class="item-title bottom-underline left-arrows">
						<span class="title">我的报修单</span>
					</div>
				</div>
				<div class="item" @click="settingClick">
					<div class="item-icon">
						<img src="../images/myAccount.png" />
					</div>
					<div class="item-title left-arrows">
						<span class="title">管理账号</span>
					</div>
				</div>
			</div>
			<div class="list margin-top20" @click="disembark">
				<div class="item">
					<div class="item-icon">
						<img src="../images/exit.png" />
					</div>
					<div class="item-title">
						<span class="title">退出登录</span>
					</div>
				</div>
			</div>
		</div>

		<script src="../js/mui.min.js"></script>
		<script src="../js/vue.js"></script>
		<script type="text/javascript">
			mui.init({
					
			})

			mui.plusReady(function() {
				var Sdata = plus.webview.currentWebview();
				
				var test = plus.webview.getWebviewById('pages/setting.html')
				// console.log(JSON.stringify(Sdata.username));
				document.getElementById("name").innerText = Sdata.username;
				document.getElementById("account").innerText = "用户账号：" + Sdata.account;
				var user = new Vue({
					el: '#user',
					data: {},
					methods: {
						messageClick: function() {
							mui.openWindow({
								url: 'myOrder.html',
								id: 'myOrder.html',
								extras: {
									userID: Sdata.userID
								},
								waiting: {
									autoShow: false
								}
							});
						},
						settingClick: function() {
							plus.nativeUI.actionSheet({
								cancel: "取消",
								buttons: [{
										title: "修改密码"
									},
									{
										title: "关于我们"
									},
									{
										title: '意见反馈'
									}
								]
							}, function(e) {
								var htmlUrl
								if(e.index == 1) {
									htmlUrl = 'Arrangement/resetPassword.html'
								} else if(e.index == 2) {
									htmlUrl = 'Arrangement/AboutUs.html'
								} else if(e.index == 3) {
									htmlUrl = 'Arrangement/feedBack.html'
								}
								if(htmlUrl) {
									mui.openWindow({
										url: htmlUrl,
										id: htmlUrl,
										waiting: {
											autoShow: false
										}
									});
								}
				
							});
						},
						disembark: function() {
							plus.nativeUI.confirm("您要退出登录吗？", function(e) {
								if(e.index == 0) {
									plus.storage.removeItem("ipone");
									setTimeout(function() {
										plus.runtime.restart();
									}, 500)
								}
							});
						}
					}
				})
			})
		</script>
	</body>

</html>